package serverapp;

import java.beans.XMLDecoder;
import java.beans.XMLEncoder;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

/**
 *
 * @author a
 */
public class ServerView extends javax.swing.JFrame {

    static ArrayList<Player> homePlayers = new ArrayList();
    static ArrayList<Player> awayPlayers = new ArrayList();
    static ArrayList<Player> players = new ArrayList();
    static Team homeTeam;
    static Team awayTeam;
    static Referee referee;
    static Hall hall;
    static Database myBase = new Database();
    final JFileChooser fc = new JFileChooser();
    int homeScore;
    int awayScore;
    int homeSet1Score;
    int homeSet2Score;
    int homeSet3Score;
    int homeSet4Score;
    int homeSet5Score;
    int awaySet1Score;
    int awaySet2Score;
    int awaySet3Score;
    int awaySet4Score;
    int awaySet5Score;
    int mode = -1;
    private static ServerSocket serverSocket;
    private static int port = 13667;
    private static ServerConnection serverConnection;
    public static boolean endMatch = false;

    public ServerView() {
        initComponents();
        homeScore = 0;
        awayScore = 0;
        homeSet1Score = 0;
        homeSet2Score = 0;
        homeSet3Score = 0;
        homeSet4Score = 0;
        homeSet5Score = 0;
        awaySet1Score = 0;
        awaySet2Score = 0;
        awaySet3Score = 0;
        awaySet4Score = 0;
        awaySet5Score = 0;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        teamNameLabel1 = new javax.swing.JLabel();
        teamNameLabel2 = new javax.swing.JLabel();
        initializeMatchButton = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        coach1Label = new javax.swing.JLabel();
        coach2Label = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        player1HomeLabel = new javax.swing.JLabel();
        player2HomeLabel = new javax.swing.JLabel();
        player3HomeLabel = new javax.swing.JLabel();
        player4HomeLabel = new javax.swing.JLabel();
        player5HomeLabel = new javax.swing.JLabel();
        player6HomeLabel = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        player1AwayLabel = new javax.swing.JLabel();
        player2AwayLabel = new javax.swing.JLabel();
        player3AwayLabel = new javax.swing.JLabel();
        player4AwayLabel = new javax.swing.JLabel();
        player5AwayLabel = new javax.swing.JLabel();
        player6AwayLabel = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        refereeLabel = new javax.swing.JLabel();
        hallLabel = new javax.swing.JLabel();
        sendButton = new javax.swing.JButton();
        loadButton = new javax.swing.JButton();
        saveButton = new javax.swing.JButton();
        jLabel19 = new javax.swing.JLabel();
        homeScoreLabel = new javax.swing.JLabel();
        awayScoreLabel = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        homeScoreButtonDecrease = new javax.swing.JButton();
        awayScoreButtonDecrease = new javax.swing.JButton();
        updateButton = new javax.swing.JButton();
        refereeNoteField = new javax.swing.JTextField();
        hallAttendanceField = new javax.swing.JTextField();
        countryField = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        homeSet1Label = new javax.swing.JLabel();
        homeSet1PlusButton = new javax.swing.JButton();
        homeSet1MinusButton = new javax.swing.JButton();
        awaySet1Label = new javax.swing.JLabel();
        awaySet1PlusButton = new javax.swing.JButton();
        awaySet1MinusButton = new javax.swing.JButton();
        homeSet2Label = new javax.swing.JLabel();
        homeSet2PlusButton = new javax.swing.JButton();
        homeSet2MinusButton = new javax.swing.JButton();
        awaySet2Label = new javax.swing.JLabel();
        awaySet2PlusButton = new javax.swing.JButton();
        awaySet2MinusButton = new javax.swing.JButton();
        awaySet4Label = new javax.swing.JLabel();
        homeSet4MinusButton = new javax.swing.JButton();
        homeSet4PlusButton = new javax.swing.JButton();
        awaySet4PlusButton = new javax.swing.JButton();
        awaySet4MinusButton = new javax.swing.JButton();
        homeSet3Label = new javax.swing.JLabel();
        homeSet3PlusButton = new javax.swing.JButton();
        homeSet3MinusButton = new javax.swing.JButton();
        awaySet3Label = new javax.swing.JLabel();
        awaySet3PlusButton = new javax.swing.JButton();
        awaySet3MinusButton = new javax.swing.JButton();
        homeSet4Label = new javax.swing.JLabel();
        homeSet5Label = new javax.swing.JLabel();
        homeSet5PlusButton = new javax.swing.JButton();
        homeSet5MinusButton = new javax.swing.JButton();
        awaySet5Label = new javax.swing.JLabel();
        awaySet5PlusButton = new javax.swing.JButton();
        awaySet5MinusButton = new javax.swing.JButton();
        aboutButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Volleyball Match Server");

        jLabel1.setText("TEAM 1 :");

        jLabel2.setText("TEAM 2 :");

        initializeMatchButton.setText("Initialize match");
        initializeMatchButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                initializeMatchButtonActionPerformed(evt);
            }
        });

        jLabel3.setText("Coach :");

        jLabel4.setText("Coach :");

        jLabel5.setText("Player 1:");

        jLabel6.setText("Player 2:");

        jLabel7.setText("Player 3:");

        jLabel8.setText("Player 4:");

        jLabel9.setText("Player 5:");

        jLabel10.setText("Player6 :");

        jLabel11.setText("Player 1:");

        jLabel12.setText("Player 2:");

        jLabel13.setText("Player 3:");

        jLabel14.setText("Player 4:");

        jLabel15.setText("Player 5:");

        jLabel16.setText("Player 6:");

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);

        jLabel17.setText("Referee :");

        jLabel18.setText("Hall :");

        sendButton.setText("Send to Clients");
        sendButton.setEnabled(false);
        sendButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sendButtonActionPerformed(evt);
            }
        });

        loadButton.setText("Load from XML");
        loadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loadButtonActionPerformed(evt);
            }
        });

        saveButton.setText("Save to XML");
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });

        jLabel19.setText("Home : ");

        homeScoreLabel.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        homeScoreLabel.setText("0");

        awayScoreLabel.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        awayScoreLabel.setText("0");

        jLabel22.setText("Away : ");

        homeScoreButtonDecrease.setText("-");
        homeScoreButtonDecrease.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeScoreButtonDecreaseActionPerformed(evt);
            }
        });

        awayScoreButtonDecrease.setText("-");
        awayScoreButtonDecrease.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awayScoreButtonDecreaseActionPerformed(evt);
            }
        });

        updateButton.setText("Update stats");
        updateButton.setToolTipText("");
        updateButton.setEnabled(false);
        updateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                updateButtonActionPerformed(evt);
            }
        });

        refereeNoteField.setToolTipText("");

        countryField.setToolTipText("");

        jLabel20.setText("Country:");
        jLabel20.setToolTipText("");

        homeSet1Label.setText("0");

        homeSet1PlusButton.setText("+");
        homeSet1PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet1PlusButtonActionPerformed(evt);
            }
        });

        homeSet1MinusButton.setText("-");
        homeSet1MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet1MinusButtonActionPerformed(evt);
            }
        });

        awaySet1Label.setText("0");

        awaySet1PlusButton.setText("+");
        awaySet1PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet1PlusButtonActionPerformed(evt);
            }
        });

        awaySet1MinusButton.setText("-");
        awaySet1MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet1MinusButtonActionPerformed(evt);
            }
        });

        homeSet2Label.setText("0");

        homeSet2PlusButton.setText("+");
        homeSet2PlusButton.setEnabled(false);
        homeSet2PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet2PlusButtonActionPerformed(evt);
            }
        });

        homeSet2MinusButton.setText("-");
        homeSet2MinusButton.setEnabled(false);
        homeSet2MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet2MinusButtonActionPerformed(evt);
            }
        });

        awaySet2Label.setText("0");

        awaySet2PlusButton.setText("+");
        awaySet2PlusButton.setEnabled(false);
        awaySet2PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet2PlusButtonActionPerformed(evt);
            }
        });

        awaySet2MinusButton.setText("-");
        awaySet2MinusButton.setEnabled(false);
        awaySet2MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet2MinusButtonActionPerformed(evt);
            }
        });

        awaySet4Label.setText("0");

        homeSet4MinusButton.setText("-");
        homeSet4MinusButton.setEnabled(false);
        homeSet4MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet4MinusButtonActionPerformed(evt);
            }
        });

        homeSet4PlusButton.setText("+");
        homeSet4PlusButton.setEnabled(false);
        homeSet4PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet4PlusButtonActionPerformed(evt);
            }
        });

        awaySet4PlusButton.setText("+");
        awaySet4PlusButton.setEnabled(false);
        awaySet4PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet4PlusButtonActionPerformed(evt);
            }
        });

        awaySet4MinusButton.setText("-");
        awaySet4MinusButton.setEnabled(false);
        awaySet4MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet4MinusButtonActionPerformed(evt);
            }
        });

        homeSet3Label.setText("0");

        homeSet3PlusButton.setText("+");
        homeSet3PlusButton.setEnabled(false);
        homeSet3PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet3PlusButtonActionPerformed(evt);
            }
        });

        homeSet3MinusButton.setText("-");
        homeSet3MinusButton.setEnabled(false);
        homeSet3MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet3MinusButtonActionPerformed(evt);
            }
        });

        awaySet3Label.setText("0");

        awaySet3PlusButton.setText("+");
        awaySet3PlusButton.setEnabled(false);
        awaySet3PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet3PlusButtonActionPerformed(evt);
            }
        });

        awaySet3MinusButton.setText("-");
        awaySet3MinusButton.setEnabled(false);
        awaySet3MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet3MinusButtonActionPerformed(evt);
            }
        });

        homeSet4Label.setText("0");

        homeSet5Label.setText("0");

        homeSet5PlusButton.setText("+");
        homeSet5PlusButton.setEnabled(false);
        homeSet5PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet5PlusButtonActionPerformed(evt);
            }
        });

        homeSet5MinusButton.setText("-");
        homeSet5MinusButton.setEnabled(false);
        homeSet5MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                homeSet5MinusButtonActionPerformed(evt);
            }
        });

        awaySet5Label.setText("0");

        awaySet5PlusButton.setText("+");
        awaySet5PlusButton.setEnabled(false);
        awaySet5PlusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet5PlusButtonActionPerformed(evt);
            }
        });

        awaySet5MinusButton.setText("-");
        awaySet5MinusButton.setEnabled(false);
        awaySet5MinusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                awaySet5MinusButtonActionPerformed(evt);
            }
        });

        aboutButton.setText("About");
        aboutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aboutButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(initializeMatchButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(updateButton)
                        .addGap(91, 91, 91)
                        .addComponent(aboutButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                        .addComponent(saveButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(loadButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(sendButton))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(teamNameLabel1)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(coach1Label))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player1HomeLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player2HomeLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player3HomeLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player4HomeLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player5HomeLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player6HomeLabel))
                            .addComponent(jLabel20)
                            .addComponent(countryField, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(29, 29, 29)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(4, 4, 4)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel19)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(homeScoreLabel)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addGap(49, 49, 49)
                                                .addComponent(homeScoreButtonDecrease))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(homeSet1PlusButton)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(homeSet1MinusButton)))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel18)
                                        .addGap(0, 0, Short.MAX_VALUE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addComponent(hallLabel)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel22)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(awayScoreLabel)
                                                .addGap(53, 53, 53)
                                                .addComponent(awayScoreButtonDecrease))
                                            .addGroup(layout.createSequentialGroup()
                                                .addGap(17, 17, 17)
                                                .addComponent(awaySet1PlusButton)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(awaySet1MinusButton))
                                            .addComponent(awaySet1Label))
                                        .addGap(79, 79, 79))))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(6, 6, 6)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(refereeNoteField))
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(refereeLabel))
                                            .addGroup(layout.createSequentialGroup()
                                                .addGap(72, 72, 72)
                                                .addComponent(hallAttendanceField, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addGroup(layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(homeSet1Label)
                                            .addGroup(layout.createSequentialGroup()
                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addGap(17, 17, 17)
                                                        .addComponent(homeSet2PlusButton)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(homeSet2MinusButton))
                                                    .addComponent(homeSet2Label)
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addComponent(homeSet3Label)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(homeSet3PlusButton))
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addComponent(homeSet4Label)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(homeSet4PlusButton))
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addComponent(homeSet5Label)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(homeSet5PlusButton)))
                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(awaySet2Label)
                                                            .addGroup(layout.createSequentialGroup()
                                                                .addGap(17, 17, 17)
                                                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                                    .addGroup(layout.createSequentialGroup()
                                                                        .addComponent(awaySet3PlusButton)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(awaySet3MinusButton))
                                                                    .addGroup(layout.createSequentialGroup()
                                                                        .addComponent(awaySet2PlusButton)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(awaySet2MinusButton))
                                                                    .addGroup(layout.createSequentialGroup()
                                                                        .addComponent(awaySet4PlusButton)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(awaySet4MinusButton))
                                                                    .addGroup(layout.createSequentialGroup()
                                                                        .addComponent(awaySet5PlusButton)
                                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(awaySet5MinusButton))))))
                                                    .addGroup(layout.createSequentialGroup()
                                                        .addGap(9, 9, 9)
                                                        .addComponent(awaySet5Label))))))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(75, 75, 75)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(homeSet4MinusButton)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(awaySet4Label))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(homeSet3MinusButton)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(awaySet3Label))
                                            .addComponent(homeSet5MinusButton))))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel16)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player6AwayLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel15)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player5AwayLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel14)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player4AwayLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player3AwayLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player2AwayLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(player1AwayLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(coach2Label))
                            .addComponent(jLabel2)
                            .addComponent(teamNameLabel2))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator3)
                    .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(teamNameLabel1)
                            .addComponent(teamNameLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(coach1Label)
                            .addComponent(coach2Label))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(player1HomeLabel)
                            .addComponent(jLabel11)
                            .addComponent(player1AwayLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(player2HomeLabel)
                            .addComponent(jLabel12)
                            .addComponent(player2AwayLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(player3HomeLabel)
                            .addComponent(jLabel13)
                            .addComponent(player3AwayLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(player4HomeLabel)
                            .addComponent(jLabel14)
                            .addComponent(player4AwayLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(player5HomeLabel)
                            .addComponent(jLabel15)
                            .addComponent(player5AwayLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel10)
                            .addComponent(player6HomeLabel)
                            .addComponent(jLabel16)
                            .addComponent(player6AwayLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(countryField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(refereeLabel)
                            .addComponent(jLabel18))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(refereeNoteField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(hallAttendanceField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(hallLabel)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel22)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(awayScoreLabel)
                                    .addComponent(awayScoreButtonDecrease))
                                .addGap(33, 33, 33))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addComponent(jLabel19)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addComponent(homeScoreLabel)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(homeSet1Label)
                                            .addComponent(homeSet1PlusButton)
                                            .addComponent(homeSet1MinusButton)
                                            .addComponent(awaySet1Label)
                                            .addComponent(awaySet1PlusButton)
                                            .addComponent(awaySet1MinusButton))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(homeScoreButtonDecrease)
                                        .addGap(0, 0, Short.MAX_VALUE)))))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(homeSet2Label)
                            .addComponent(homeSet2PlusButton)
                            .addComponent(homeSet2MinusButton)
                            .addComponent(awaySet2Label)
                            .addComponent(awaySet2PlusButton)
                            .addComponent(awaySet2MinusButton))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(4, 4, 4)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(homeSet3Label)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(homeSet3PlusButton)
                                        .addComponent(homeSet3MinusButton))))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(awaySet3PlusButton)
                                        .addComponent(awaySet3MinusButton))
                                    .addComponent(awaySet3Label))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(homeSet4Label)
                            .addComponent(homeSet4PlusButton)
                            .addComponent(homeSet4MinusButton)
                            .addComponent(awaySet4PlusButton)
                            .addComponent(awaySet4MinusButton)
                            .addComponent(awaySet4Label))
                        .addGap(5, 5, 5)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(homeSet5Label)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(homeSet5PlusButton)
                                .addComponent(homeSet5MinusButton)
                                .addComponent(awaySet5Label)
                                .addComponent(awaySet5PlusButton)
                                .addComponent(awaySet5MinusButton)))
                        .addGap(49, 49, 49)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(initializeMatchButton)
                    .addComponent(sendButton)
                    .addComponent(loadButton)
                    .addComponent(saveButton)
                    .addComponent(updateButton)
                    .addComponent(aboutButton))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void initializeMatchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_initializeMatchButtonActionPerformed
        ChooseTeams teams = new ChooseTeams(countryField.getText());
        teams.setVisible(true);
    }//GEN-LAST:event_initializeMatchButtonActionPerformed

    private void sendButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sendButtonActionPerformed
        ConnectionHandler connectionHandler = serverConnection.connectionHandlerList.get(0);
        connectionHandler.sendPlayers(homePlayers);
        ConnectionHandler connectionHandler2 = serverConnection.connectionHandlerList.get(1);
        connectionHandler2.sendPlayers(awayPlayers);
        sendButton.setEnabled(false);
    }//GEN-LAST:event_sendButtonActionPerformed

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        try {
            File xmlFile = new File("players.xml");
            XMLEncoder encoder = new XMLEncoder(new FileOutputStream(xmlFile));
            encoder.writeObject(new MatchPlayers(this.homePlayers, this.awayPlayers));
            encoder.close();
        } catch (IOException ex) {
            java.util.logging.Logger.getLogger(ServerView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_saveButtonActionPerformed

    public int showTripleQuestion() {
        Object[] options = {"BOTH", "HOME", "AWAY"};
        int n = JOptionPane.showOptionDialog(this,
                "Please select SINGLE or BOTH",
                "A Silly Question",
                JOptionPane.YES_NO_OPTION,
                JOptionPane.QUESTION_MESSAGE,
                null, //do not use a custom Icon
                options, //the titles of buttons
                options[0]); //default button title
        System.out.println(n);
        return n;
    }

    private void loadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadButtonActionPerformed
        try {
            if (evt.getSource() == loadButton) {
                int returnVal = fc.showOpenDialog(this);

                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    File file = fc.getSelectedFile();
                    System.out.println("Opening: " + file.getName() + ".\n");
                    XMLDecoder decoder = new XMLDecoder(new FileInputStream(file));

                    int n = this.showTripleQuestion();
                    if (n == 0) {
                        MatchPlayers nm = (MatchPlayers) decoder.readObject();
                        this.homePlayers = nm.getHome();
                        this.awayPlayers = nm.getAway();
                        this.mode = n;
                        setPlayersVisible();
                    } else if (n == 1) {
                        MatchPlayers nm = (MatchPlayers) decoder.readObject();
                        this.homePlayers = nm.getHome();
                        this.mode = n;
                        this.setHomePlayersVisible();
                    } else { // n=2
                        MatchPlayers nm = (MatchPlayers) decoder.readObject();
                        this.mode = n;
                        this.awayPlayers = nm.getHome();
                        this.setAwayPlayersVisible();
                    }

                } else {
                    System.out.println("Open command cancelled by user.\n");
                }
            }
        } catch (IOException ex) {
            java.util.logging.Logger.getLogger(ServerView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_loadButtonActionPerformed

    private void setHomePlayersVisible() {
        ServerView.player1HomeLabel.setText(homePlayers.get(0).name + " " + homePlayers.get(0).surname);
        ServerView.player2HomeLabel.setText(homePlayers.get(1).name + " " + homePlayers.get(1).surname);
        ServerView.player3HomeLabel.setText(homePlayers.get(2).name + " " + homePlayers.get(2).surname);
        ServerView.player4HomeLabel.setText(homePlayers.get(3).name + " " + homePlayers.get(3).surname);
        ServerView.player5HomeLabel.setText(homePlayers.get(4).name + " " + homePlayers.get(4).surname);
        ServerView.player6HomeLabel.setText(homePlayers.get(5).name + " " + homePlayers.get(5).surname);
    }

    private void setAwayPlayersVisible() {
        ServerView.player1AwayLabel.setText(awayPlayers.get(0).name + " " + awayPlayers.get(0).surname);
        ServerView.player2AwayLabel.setText(awayPlayers.get(1).name + " " + awayPlayers.get(1).surname);
        ServerView.player3AwayLabel.setText(awayPlayers.get(2).name + " " + awayPlayers.get(2).surname);
        ServerView.player4AwayLabel.setText(awayPlayers.get(3).name + " " + awayPlayers.get(3).surname);
        ServerView.player5AwayLabel.setText(awayPlayers.get(4).name + " " + awayPlayers.get(4).surname);
        ServerView.player6AwayLabel.setText(awayPlayers.get(5).name + " " + awayPlayers.get(5).surname);
    }

    private void setPlayersVisible() {
        this.setHomePlayersVisible();
        this.setAwayPlayersVisible();
    }

    private void homeScoreButtonDecreaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeScoreButtonDecreaseActionPerformed
        if (homeScore > 0 && awayScore < 3) {
            homeScore--;
            String numberToLabel = Integer.toString(homeScore);
            homeScoreLabel.setText(numberToLabel);
            active();
        }
    }//GEN-LAST:event_homeScoreButtonDecreaseActionPerformed

    private void awayScoreButtonDecreaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awayScoreButtonDecreaseActionPerformed
        if (awayScore > 0 && homeScore<3) {
            awayScore--;
            String numberToLabel = Integer.toString(awayScore);
            awayScoreLabel.setText(numberToLabel);
            active();
        }
    }//GEN-LAST:event_awayScoreButtonDecreaseActionPerformed

    private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
        countTeamStats();
        Calendar c = Calendar.getInstance();
        int day = c.get(Calendar.DAY_OF_MONTH);
        int month = c.get(Calendar.MONTH);
        int year = c.get(Calendar.YEAR);
        for (int i = 0; i < players.size(); i++) {
            myBase.updatePlayerStats(day, month, year, players.get(i));
        }
        myBase.updateTeamStats(day, month, year, homeTeam);
        myBase.updateTeamStats(day, month, year, awayTeam);
        myBase.updateRefereeStats(day, month, year, referee, Integer.parseInt(refereeNoteField.getText()));
        myBase.updateHallStats(day, month, year, hall, Integer.parseInt(hallAttendanceField.getText()));
        myBase.updateResults(day, month, year, hall.id, homeTeam.id, awayTeam.id, homeScore, awayScore);
        if(homeScore>awayScore){
            myBase.updateTable(homeTeam.id, year, true, homeScore, awayScore, homeSet1Score+homeSet2Score+homeSet3Score+homeSet4Score+homeSet5Score, awaySet1Score+awaySet2Score+awaySet3Score+awaySet4Score+awaySet5Score);
            myBase.updateTable(awayTeam.id, year, false, awayScore, homeScore, awaySet1Score+awaySet2Score+awaySet3Score+awaySet4Score+awaySet5Score, homeSet1Score+homeSet2Score+homeSet3Score+homeSet4Score+homeSet5Score);
        } else {
            myBase.updateTable(homeTeam.id, year, false, homeScore, awayScore, homeSet1Score+homeSet2Score+homeSet3Score+homeSet4Score+homeSet5Score, awaySet1Score+awaySet2Score+awaySet3Score+awaySet4Score+awaySet5Score);
            myBase.updateTable(awayTeam.id, year, true, awayScore, homeScore, awaySet1Score+awaySet2Score+awaySet3Score+awaySet4Score+awaySet5Score, homeSet1Score+homeSet2Score+homeSet3Score+homeSet4Score+homeSet5Score);
        }
    }//GEN-LAST:event_updateButtonActionPerformed

    private void homeSet1PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet1PlusButtonActionPerformed
        homeSet1Score++;
        String numberToLabel = Integer.toString(homeSet1Score);
        homeSet1Label.setText(numberToLabel);
        if(homeSet1Score==25&&awaySet1Score<24 || (homeSet1Score>25 && awaySet1Score==homeSet1Score-2)){
            homeIncrease();
        }
    }//GEN-LAST:event_homeSet1PlusButtonActionPerformed

    private void homeSet1MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet1MinusButtonActionPerformed
        if (homeSet1Score > 0) {
            homeSet1Score--;
            String numberToLabel = Integer.toString(homeSet1Score);
            homeSet1Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_homeSet1MinusButtonActionPerformed

    private void awaySet1PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet1PlusButtonActionPerformed
        awaySet1Score++;
        String numberToLabel = Integer.toString(awaySet1Score);
        awaySet1Label.setText(numberToLabel);
        if(awaySet1Score==25&&homeSet1Score<24 || (awaySet1Score>25 && homeSet1Score==awaySet1Score-2)){
            awayIncrease();
        }
    }//GEN-LAST:event_awaySet1PlusButtonActionPerformed

    private void awaySet1MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet1MinusButtonActionPerformed
        if (awaySet1Score > 0) {
            awaySet1Score--;
            String numberToLabel = Integer.toString(awaySet1Score);
            awaySet1Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_awaySet1MinusButtonActionPerformed

    private void homeSet2PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet2PlusButtonActionPerformed
        homeSet2Score++;
        String numberToLabel = Integer.toString(homeSet2Score);
        homeSet2Label.setText(numberToLabel);
        if(homeSet2Score==25&&awaySet2Score<24 || (homeSet2Score>25 && awaySet2Score==homeSet2Score-2)){
            homeIncrease();
        }
    }//GEN-LAST:event_homeSet2PlusButtonActionPerformed

    private void homeSet2MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet2MinusButtonActionPerformed
        if (homeSet2Score > 0) {
            homeSet2Score--;
            String numberToLabel = Integer.toString(homeSet2Score);
            homeSet2Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_homeSet2MinusButtonActionPerformed

    private void awaySet2PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet2PlusButtonActionPerformed
        awaySet2Score++;
        String numberToLabel = Integer.toString(awaySet2Score);
        awaySet2Label.setText(numberToLabel);
        if(awaySet2Score==25&&homeSet2Score<24 || (awaySet2Score>25 && homeSet2Score==awaySet2Score-2)){
            awayIncrease();
        }
    }//GEN-LAST:event_awaySet2PlusButtonActionPerformed

    private void awaySet2MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet2MinusButtonActionPerformed
        if (awaySet2Score > 0) {
            awaySet2Score--;
            String numberToLabel = Integer.toString(awaySet2Score);
            awaySet2Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_awaySet2MinusButtonActionPerformed

    private void homeSet3PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet3PlusButtonActionPerformed
        homeSet3Score++;
        String numberToLabel = Integer.toString(homeSet3Score);
        homeSet3Label.setText(numberToLabel);
        if(homeSet3Score==25&&awaySet3Score<24 || (homeSet3Score>25 && awaySet3Score==homeSet3Score-2)){
            homeIncrease();
        }
    }//GEN-LAST:event_homeSet3PlusButtonActionPerformed

    private void homeSet3MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet3MinusButtonActionPerformed
        if (homeSet3Score > 0) {
            homeSet3Score--;
            String numberToLabel = Integer.toString(homeSet3Score);
            homeSet3Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_homeSet3MinusButtonActionPerformed

    private void awaySet3PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet3PlusButtonActionPerformed
        awaySet3Score++;
        String numberToLabel = Integer.toString(awaySet3Score);
        awaySet3Label.setText(numberToLabel);
        if(awaySet3Score==25&&homeSet3Score<24 || (awaySet3Score>25 && homeSet3Score==awaySet3Score-2)){
            awayIncrease();
        }
    }//GEN-LAST:event_awaySet3PlusButtonActionPerformed

    private void awaySet3MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet3MinusButtonActionPerformed
        if (awaySet3Score > 0) {
            awaySet3Score--;
            String numberToLabel = Integer.toString(awaySet3Score);
            awaySet3Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_awaySet3MinusButtonActionPerformed

    private void homeSet4PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet4PlusButtonActionPerformed
        homeSet4Score++;
        String numberToLabel = Integer.toString(homeSet4Score);
        homeSet4Label.setText(numberToLabel);
        if(homeSet4Score==25&&awaySet4Score<24 || (homeSet4Score>25 && awaySet4Score==homeSet4Score-2)){
            homeIncrease();
        }
    }//GEN-LAST:event_homeSet4PlusButtonActionPerformed

    private void homeSet4MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet4MinusButtonActionPerformed
        if (homeSet4Score > 0) {
            homeSet4Score--;
            String numberToLabel = Integer.toString(homeSet4Score);
            homeSet4Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_homeSet4MinusButtonActionPerformed

    private void awaySet4PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet4PlusButtonActionPerformed
        awaySet4Score++;
        String numberToLabel = Integer.toString(awaySet4Score);
        awaySet4Label.setText(numberToLabel);
        if(awaySet4Score==25&&homeSet4Score<24 || (awaySet4Score>25 && homeSet4Score==awaySet4Score-2)){
            awayIncrease();
        }
    }//GEN-LAST:event_awaySet4PlusButtonActionPerformed

    private void awaySet4MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet4MinusButtonActionPerformed
        if (awaySet4Score > 0) {
            awaySet4Score--;
            String numberToLabel = Integer.toString(awaySet4Score);
            awaySet4Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_awaySet4MinusButtonActionPerformed

    private void homeSet5PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet5PlusButtonActionPerformed
        homeSet5Score++;
        String numberToLabel = Integer.toString(homeSet5Score);
        homeSet5Label.setText(numberToLabel);
        if(homeSet5Score==15&&awaySet5Score<14 || (homeSet5Score>15 && awaySet5Score==homeSet5Score-2)){
            homeIncrease();
        }
    }//GEN-LAST:event_homeSet5PlusButtonActionPerformed

    private void homeSet5MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_homeSet5MinusButtonActionPerformed
        if (homeSet5Score > 0) {
            homeSet5Score--;
            String numberToLabel = Integer.toString(homeSet5Score);
            homeSet5Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_homeSet5MinusButtonActionPerformed

    private void awaySet5PlusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet5PlusButtonActionPerformed
        awaySet5Score++;
        String numberToLabel = Integer.toString(awaySet5Score);
        awaySet5Label.setText(numberToLabel);
        if(awaySet5Score==15&&homeSet5Score<14 || (awaySet5Score>15 && homeSet5Score==awaySet5Score-2)){
            awayIncrease();
        }
    }//GEN-LAST:event_awaySet5PlusButtonActionPerformed

    private void awaySet5MinusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_awaySet5MinusButtonActionPerformed
        if (awaySet5Score > 0) {
            awaySet5Score--;
            String numberToLabel = Integer.toString(awaySet5Score);
            awaySet5Label.setText(numberToLabel);
        }
    }//GEN-LAST:event_awaySet5MinusButtonActionPerformed

    private void aboutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutButtonActionPerformed
        JOptionPane.showMessageDialog(null, "Volleyball Match Server v.0.00001.01101\nCopyright by:\nMaciej Niemczyk\nMaciej Nowak\nBartłomiej Paciorek","About",JOptionPane.ERROR_MESSAGE);
    }//GEN-LAST:event_aboutButtonActionPerformed

    private void active() {
        if (homeScore + awayScore == 0) {
            homeSet1PlusButton.setEnabled(true);
            homeSet2PlusButton.setEnabled(false);
            homeSet3PlusButton.setEnabled(false);
            homeSet4PlusButton.setEnabled(false);
            homeSet5PlusButton.setEnabled(false);
            homeSet1MinusButton.setEnabled(true);
            homeSet2MinusButton.setEnabled(false);
            homeSet3MinusButton.setEnabled(false);
            homeSet4MinusButton.setEnabled(false);
            homeSet5MinusButton.setEnabled(false);
            awaySet1PlusButton.setEnabled(true);
            awaySet2PlusButton.setEnabled(false);
            awaySet3PlusButton.setEnabled(false);
            awaySet4PlusButton.setEnabled(false);
            awaySet5PlusButton.setEnabled(false);
            awaySet1MinusButton.setEnabled(true);
            awaySet2MinusButton.setEnabled(false);
            awaySet3MinusButton.setEnabled(false);
            awaySet4MinusButton.setEnabled(false);
            awaySet5MinusButton.setEnabled(false);
            updateButton.setEnabled(false);
        } else if (homeScore + awayScore == 1) {
            homeSet1PlusButton.setEnabled(false);
            homeSet2PlusButton.setEnabled(true);
            homeSet3PlusButton.setEnabled(false);
            homeSet4PlusButton.setEnabled(false);
            homeSet5PlusButton.setEnabled(false);
            homeSet1MinusButton.setEnabled(false);
            homeSet2MinusButton.setEnabled(true);
            homeSet3MinusButton.setEnabled(false);
            homeSet4MinusButton.setEnabled(false);
            homeSet5MinusButton.setEnabled(false);
            awaySet1PlusButton.setEnabled(false);
            awaySet2PlusButton.setEnabled(true);
            awaySet3PlusButton.setEnabled(false);
            awaySet4PlusButton.setEnabled(false);
            awaySet5PlusButton.setEnabled(false);
            awaySet1MinusButton.setEnabled(false);
            awaySet2MinusButton.setEnabled(true);
            awaySet3MinusButton.setEnabled(false);
            awaySet4MinusButton.setEnabled(false);
            awaySet5MinusButton.setEnabled(false);
            updateButton.setEnabled(false);
        } else if (homeScore + awayScore == 2) {
            homeSet1PlusButton.setEnabled(false);
            homeSet2PlusButton.setEnabled(false);
            homeSet3PlusButton.setEnabled(true);
            homeSet4PlusButton.setEnabled(false);
            homeSet5PlusButton.setEnabled(false);
            homeSet1MinusButton.setEnabled(false);
            homeSet2MinusButton.setEnabled(false);
            homeSet3MinusButton.setEnabled(true);
            homeSet4MinusButton.setEnabled(false);
            homeSet5MinusButton.setEnabled(false);
            awaySet1PlusButton.setEnabled(false);
            awaySet2PlusButton.setEnabled(false);
            awaySet3PlusButton.setEnabled(true);
            awaySet4PlusButton.setEnabled(false);
            awaySet5PlusButton.setEnabled(false);
            awaySet1MinusButton.setEnabled(false);
            awaySet2MinusButton.setEnabled(false);
            awaySet3MinusButton.setEnabled(true);
            awaySet4MinusButton.setEnabled(false);
            awaySet5MinusButton.setEnabled(false);
            updateButton.setEnabled(false);
        } else if (homeScore + awayScore == 3) {
            homeSet1PlusButton.setEnabled(false);
            homeSet2PlusButton.setEnabled(false);
            homeSet3PlusButton.setEnabled(false);
            homeSet4PlusButton.setEnabled(true);
            homeSet5PlusButton.setEnabled(false);
            homeSet1MinusButton.setEnabled(false);
            homeSet2MinusButton.setEnabled(false);
            homeSet3MinusButton.setEnabled(false);
            homeSet4MinusButton.setEnabled(true);
            homeSet5MinusButton.setEnabled(false);
            awaySet1PlusButton.setEnabled(false);
            awaySet2PlusButton.setEnabled(false);
            awaySet3PlusButton.setEnabled(false);
            awaySet4PlusButton.setEnabled(true);
            awaySet5PlusButton.setEnabled(false);
            awaySet1MinusButton.setEnabled(false);
            awaySet2MinusButton.setEnabled(false);
            awaySet3MinusButton.setEnabled(false);
            awaySet4MinusButton.setEnabled(true);
            awaySet5MinusButton.setEnabled(false);
            updateButton.setEnabled(false);
        } else if (homeScore + awayScore == 4) {
            homeSet1PlusButton.setEnabled(false);
            homeSet2PlusButton.setEnabled(false);
            homeSet3PlusButton.setEnabled(false);
            homeSet4PlusButton.setEnabled(false);
            homeSet5PlusButton.setEnabled(true);
            homeSet1MinusButton.setEnabled(false);
            homeSet2MinusButton.setEnabled(false);
            homeSet3MinusButton.setEnabled(false);
            homeSet4MinusButton.setEnabled(false);
            homeSet5MinusButton.setEnabled(true);
            awaySet1PlusButton.setEnabled(false);
            awaySet2PlusButton.setEnabled(false);
            awaySet3PlusButton.setEnabled(false);
            awaySet4PlusButton.setEnabled(false);
            awaySet5PlusButton.setEnabled(true);
            awaySet1MinusButton.setEnabled(false);
            awaySet2MinusButton.setEnabled(false);
            awaySet3MinusButton.setEnabled(false);
            awaySet4MinusButton.setEnabled(false);
            awaySet5MinusButton.setEnabled(true);
            updateButton.setEnabled(false);
        } else {
            deactive();
        }
    }
    
    private void deactive(){
        homeSet1PlusButton.setEnabled(false);
            homeSet2PlusButton.setEnabled(false);
            homeSet3PlusButton.setEnabled(false);
            homeSet4PlusButton.setEnabled(false);
            homeSet5PlusButton.setEnabled(false);
            homeSet1MinusButton.setEnabled(false);
            homeSet2MinusButton.setEnabled(false);
            homeSet3MinusButton.setEnabled(false);
            homeSet4MinusButton.setEnabled(false);
            homeSet5MinusButton.setEnabled(false);
            awaySet1PlusButton.setEnabled(false);
            awaySet2PlusButton.setEnabled(false);
            awaySet3PlusButton.setEnabled(false);
            awaySet4PlusButton.setEnabled(false);
            awaySet5PlusButton.setEnabled(false);
            awaySet1MinusButton.setEnabled(false);
            awaySet2MinusButton.setEnabled(false);
            awaySet3MinusButton.setEnabled(false);
            awaySet4MinusButton.setEnabled(false);
            awaySet5MinusButton.setEnabled(false);
            updateButton.setEnabled(true);
    }

    private void homeIncrease(){
        if (homeScore < 3 && awayScore < 3) {
            homeScore++;
            String numberToLabel = Integer.toString(homeScore);
            homeScoreLabel.setText(numberToLabel);
            active();
            if(homeScore==3){
                deactive();
            }
        }
    }
    
    private void awayIncrease(){
        if (awayScore < 3 && homeScore < 3) {
            awayScore++;
            String numberToLabel = Integer.toString(awayScore);
            awayScoreLabel.setText(numberToLabel);
            active();
            if(awayScore==3){
                deactive();
            }
        }
    }
    private void countTeamStats() {
        String homeName = homeTeam.name;
        String awayName = awayTeam.name;
        for (int i = 0; i < players.size(); i++) {
            Player player = players.get(i);
            String playerTeam = player.club;
            if (homeName.equals(playerTeam)) {
                homeTeam.blockedAttacks = homeTeam.blockedAttacks + player.blockedAttacks;
                homeTeam.bouncedDefences = homeTeam.bouncedDefences + player.bouncedDefences;
                homeTeam.bouncedReceives = homeTeam.bouncedReceives + player.bouncedReceives;
                homeTeam.defencesNet = homeTeam.defencesNet + player.defencesNet;
                homeTeam.defendedBlocks = homeTeam.defendedBlocks + player.defendedBlocks;
                homeTeam.failedAttacks = homeTeam.failedAttacks + player.failedAttacks;
                homeTeam.failedBlocks = homeTeam.failedBlocks + player.failedBlocks;
                homeTeam.failedDefences = homeTeam.failedDefences + player.failedDefences;
                homeTeam.failedPasses = homeTeam.failedPasses + player.failedPasses;
                homeTeam.failedReceives = homeTeam.failedReceives + player.failedReceives;
                homeTeam.failedServes = homeTeam.failedServes + player.failedServes;
                homeTeam.receivedServes = homeTeam.receivedServes + player.receivedServes;
                homeTeam.receivesToNet = homeTeam.receivesToNet + player.receivesToNet;
                homeTeam.serveAces = homeTeam.serveAces + player.serveAces;
                homeTeam.singleBlockPasses = homeTeam.singleBlockPasses + player.singleBlockPasses;
                homeTeam.successAttacks = homeTeam.successAttacks + player.successAttacks;
                homeTeam.successBlocks = homeTeam.successBlocks + player.successBlocks;
                homeTeam.tripleBlockPasses = homeTeam.tripleBlockPasses + player.tripleBlockPasses;
            } else if (awayName.equals(playerTeam)) {
                awayTeam.blockedAttacks = awayTeam.blockedAttacks + player.blockedAttacks;
                awayTeam.bouncedDefences = awayTeam.bouncedDefences + player.bouncedDefences;
                awayTeam.bouncedReceives = awayTeam.bouncedReceives + player.bouncedReceives;
                awayTeam.defencesNet = awayTeam.defencesNet + player.defencesNet;
                awayTeam.defendedBlocks = awayTeam.defendedBlocks + player.defendedBlocks;
                awayTeam.failedAttacks = awayTeam.failedAttacks + player.failedAttacks;
                awayTeam.failedBlocks = awayTeam.failedBlocks + player.failedBlocks;
                awayTeam.failedDefences = awayTeam.failedDefences + player.failedDefences;
                awayTeam.failedPasses = awayTeam.failedPasses + player.failedPasses;
                awayTeam.failedReceives = awayTeam.failedReceives + player.failedReceives;
                awayTeam.failedServes = awayTeam.failedServes + player.failedServes;
                awayTeam.receivedServes = awayTeam.receivedServes + player.receivedServes;
                awayTeam.receivesToNet = awayTeam.receivesToNet + player.receivesToNet;
                awayTeam.serveAces = awayTeam.serveAces + player.serveAces;
                awayTeam.singleBlockPasses = awayTeam.singleBlockPasses + player.singleBlockPasses;
                awayTeam.successAttacks = awayTeam.successAttacks + player.successAttacks;
                awayTeam.successBlocks = awayTeam.successBlocks + player.successBlocks;
                awayTeam.tripleBlockPasses = awayTeam.tripleBlockPasses + player.tripleBlockPasses;
            } else {
                System.out.println("Receivved player from team which is not playing");
            }
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ServerView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ServerView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ServerView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ServerView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new ServerView().setVisible(true);
                try {
                    serverSocket = new ServerSocket(port);
                } catch (IOException ex) {
                    Logger.getLogger(ServerView.class.getName()).log(Level.SEVERE, null, ex);
                }
                serverConnection = new ServerConnection(serverSocket);
                Thread t = new Thread(serverConnection);
                t.start();
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton aboutButton;
    private javax.swing.JButton awayScoreButtonDecrease;
    private javax.swing.JLabel awayScoreLabel;
    private javax.swing.JLabel awaySet1Label;
    private javax.swing.JButton awaySet1MinusButton;
    private javax.swing.JButton awaySet1PlusButton;
    private javax.swing.JLabel awaySet2Label;
    private javax.swing.JButton awaySet2MinusButton;
    private javax.swing.JButton awaySet2PlusButton;
    private javax.swing.JLabel awaySet3Label;
    private javax.swing.JButton awaySet3MinusButton;
    private javax.swing.JButton awaySet3PlusButton;
    private javax.swing.JLabel awaySet4Label;
    private javax.swing.JButton awaySet4MinusButton;
    private javax.swing.JButton awaySet4PlusButton;
    private javax.swing.JLabel awaySet5Label;
    private javax.swing.JButton awaySet5MinusButton;
    private javax.swing.JButton awaySet5PlusButton;
    public static javax.swing.JLabel coach1Label;
    public static javax.swing.JLabel coach2Label;
    public static javax.swing.JTextField countryField;
    private javax.swing.JTextField hallAttendanceField;
    public static javax.swing.JLabel hallLabel;
    private javax.swing.JButton homeScoreButtonDecrease;
    private javax.swing.JLabel homeScoreLabel;
    private javax.swing.JLabel homeSet1Label;
    private javax.swing.JButton homeSet1MinusButton;
    private javax.swing.JButton homeSet1PlusButton;
    private javax.swing.JLabel homeSet2Label;
    private javax.swing.JButton homeSet2MinusButton;
    private javax.swing.JButton homeSet2PlusButton;
    private javax.swing.JLabel homeSet3Label;
    private javax.swing.JButton homeSet3MinusButton;
    private javax.swing.JButton homeSet3PlusButton;
    private javax.swing.JLabel homeSet4Label;
    private javax.swing.JButton homeSet4MinusButton;
    private javax.swing.JButton homeSet4PlusButton;
    private javax.swing.JLabel homeSet5Label;
    private javax.swing.JButton homeSet5MinusButton;
    private javax.swing.JButton homeSet5PlusButton;
    private javax.swing.JButton initializeMatchButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JButton loadButton;
    public static javax.swing.JLabel player1AwayLabel;
    public static javax.swing.JLabel player1HomeLabel;
    public static javax.swing.JLabel player2AwayLabel;
    public static javax.swing.JLabel player2HomeLabel;
    public static javax.swing.JLabel player3AwayLabel;
    public static javax.swing.JLabel player3HomeLabel;
    public static javax.swing.JLabel player4AwayLabel;
    public static javax.swing.JLabel player4HomeLabel;
    public static javax.swing.JLabel player5AwayLabel;
    public static javax.swing.JLabel player5HomeLabel;
    public static javax.swing.JLabel player6AwayLabel;
    public static javax.swing.JLabel player6HomeLabel;
    public static javax.swing.JLabel refereeLabel;
    private javax.swing.JTextField refereeNoteField;
    public static javax.swing.JButton saveButton;
    public static javax.swing.JButton sendButton;
    public static javax.swing.JLabel teamNameLabel1;
    public static javax.swing.JLabel teamNameLabel2;
    private javax.swing.JButton updateButton;
    // End of variables declaration//GEN-END:variables
}
